//
//  LabelCell.m
//  HB
//
//  Created by 陶秋安 on 16/5/19.
//  Copyright © 2016年 孙智慧. All rights reserved.
//

#import "LabelCell.h"

@implementation LabelCell

-(void)opFail:(NSString *)errorMessage
{}
-(void)opSuccessForPost:(id)data
{}
-(void)opSuccessForDownLoad:(id)data andFlag:(NSString *)flag
{}

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    [self setHeight:187.0f];
    
    [_customScrollView layoutUI];

    [self loadLabel];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

     
}

#pragma mark 加载幻灯片
-(void) loadLabel
{
    operation= [[NetWorkOperation alloc] initWithDelegate:self];
    
    NSString *URL= [FxGlobal getServiceUrl:@"Recommend" andFuncName:@"Hotlable"];
    
    NSDictionary * dictInfo = @{@"url":[NSString stringWithFormat:@"%@?isall=0&pageindex=0&pagesize=0",URL]};
    
    [operation setOpInfo:dictInfo];
    
    [operation get:1];
}

-(void)opSuccessForGet:(id)data andFlag:(NSInteger)flag
{
    if(flag==1)
    {
        operation= nil;
        
        NSString *dataStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        
        NSDictionary *dataParse  = [dataStr objectFromJSONStringWithParseOptions:JKParseOptionLooseUnicode];
        
        if ([[dataParse objectForKey:@"result"] isEqualToString:@"1"])
        {
            
            NSArray *arrayData=[dataParse objectForKey:@"data"];
            
            [_customScrollView loadData:arrayData];
            
        }
        
    }
}



@end
